-- common..p_InsItem 0,'P','UIIO','VT','AB','III','III', 90.0,67.0,7.0,120,78.0,89.0,0.0,null,1348.0,'Test'
-----------------------------------------------------------------------------
-- DDL for Table'common.dbo.t_ItemMaster'
-----------------------------------------------------------------------------
print 'Creating Table common.dbo.t_ItemMaster'
go 

use common
go 

setuser 'dbo'
go 
drop table t_ItemMaster
go
create table t_ItemMaster (
	ItemId    				int                    			NOT NULL,
	Parent                	int                             NOT NULL,   --0
	Type                    varchar(2)                      NULL,      	-- determine parent or child , P or C p
	ItemCode               	varchar(50)						NULL,	   	-- TK123,PLAVE456 etc UIIO
	ItemName              	varchar(30)						NULL,	   	-- TEAK,PALLAVE,ETC   VT
	ItemClass      			varchar(10)						NULL,	   	-- class A,B etc AB
	Location                varchar(30)                     NULL,	   	--  which loocation laying III
	LotNumber      			varchar(30)						NULL,	   	--  belong to which lot number III
	Length           		decimal(10,4)					NULL,	   	--  Length 90
	Width          			decimal(10,4)					NULL,		--	Width 67
	Measurement          	varchar(10)						NULL,		--	Measurement Unit QUBICINCH(QI),EACH etc 7
	Quantity          		decimal(10,4)					NULL,		--  Quantity 120
	Units          			decimal(10,4)					NULL,		--  No of units exsist 120
	PurchasePrice      		decimal(10,4)					NULL,		--	Purchasepricen 78
	SalesPrice      		decimal(10,4)					NULL,		--	SalesPrice 89
	ProfitMargin         	decimal(10,4)					NULL,		--	ProfitMargin per unit sale  0
	PurchasedFrom			varchar(50)						NULL,		--	PurchasedFrom
	PurchasedDate    		datetime						NULL,		--	PurchasedDate
	Tax            			decimal(10,4)					NULL,		--	Tax
	AuditInformation    	varchar(100)					NULL,
	Comments        		varchar(100)					NULL,
	CompanyName    			varchar(50)						NULL		--	Item Belong to which Comapny 		
)
go
Grant Select on dbo.t_ItemMaster to public 
go
setuser
go 

